﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 行为日志表
/// </summary>
[Table("ActionLog")]
public partial class ActionLog
{
    /// <summary>
    /// 行为日志ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 用户ID
    /// </summary>
    [StringLength(32)]
    public string? UserId { get; set; }

    /// <summary>
    /// 类型
    /// </summary>
    [StringLength(64)]
    public string? Type { get; set; }

    /// <summary>
    /// 行为
    /// </summary>
    [StringLength(64)]
    public string? Action { get; set; }

    /// <summary>
    /// 记录版本
    /// </summary>
    [StringLength(32)]
    public string? Version { get; set; }

    /// <summary>
    /// 本次请求的接口地址
    /// </summary>
    [StringLength(255)]
    public string? ApiUrl { get; set; }

    /// <summary>
    /// 请求IP
    /// </summary>
    [Column("IP")]
    [StringLength(20)]
    public string? Ip { get; set; }

    /// <summary>
    /// 请求参数
    /// </summary>
    public string? Params { get; set; }

    /// <summary>
    /// 结果
    /// </summary>
    public int? Result { get; set; }

    /// <summary>
    /// 结果信息
    /// </summary>
    public string? ResultMessage { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? CreationTime { get; set; }
}
